home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / tclX6.4c / dist / tests / showprocs.test < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.4 KB  |  50 lines

  1. #
  2. # showprocs.test
  3. #
  4. # Tests for tcl.tlib showproc routines.
  5. #---------------------------------------------------------------------------
  6. # Copyright 1992 Karl Lehenbauer and Mark Diekhans.
  7. #
  8. # Permission to use, copy, modify, and distribute this software and its
  9. # documentation for any purpose and without fee is hereby granted, provided
  10. # that the above copyright notice appear in all copies.  Karl Lehenbauer and
  11. # Mark Diekhans make no representations about the suitability of this
  12. # software for any purpose.  It is provided "as is" without express or
  13. # implied warranty.
  14. #------------------------------------------------------------------------------
  15. # $Id: showprocs.test,v 2.0 1992/10/16 04:50:15 markd Rel $
  16. #------------------------------------------------------------------------------
  17. #
  18.  
  19. if {[info procs test] == ""} then {source testlib.tcl}
  20.  
  21. rename SAVED_UNKNOWN unknown
  22.  
  23. set testProcVar {proc testproc {testVar} {
  24.     return 1
  25. }}
  26.  
  27. eval $testProcVar
  28.  
  29. test showproc-1.1 {showproc command} {
  30.     showproc testproc
  31. } "$testProcVar\n"
  32.  
  33. test showprocs-1.1 {showprocs command} {
  34.     showprocs testproc
  35. } "$testProcVar\n\n"
  36.  
  37. test showprocs-1.2 {showprocs command} {
  38.     set result ""
  39.     foreach i [split [showprocs] "\n"] {
  40.     if {[lindex $i 0] == "proc"} {
  41.         lappend result [lindex $i 1]
  42.     }
  43.     }
  44.     lsort $result
  45. } [lsort [info procs]]
  46.  
  47. unset testProcVar
  48. rename testproc ""
  49. rename unknown SAVED_UNKNOWN
  50.